{% extends "base.html" %}

{% load image_resize %}
{% load url_info %}

{% block title %}Webmapper Tag: {{ tag.unique_name }}{% endblock %}

{% block content %}

<h2>{{ tag.unique_name }} details: </h2>

<h3>Routes:</h3>
{% if route_list %}
    <ul>
    {% for i in route_list %}
        <li>{{ i.name }} [
        <a href="{% url route-kml i.pk %}">kml</a>
        | <a href="{% url route-map i.pk %}">map</a>
{% if user %}{% ifequal user.id i.user.id %}
        | edit
{% endifequal %}{% endif %}
        ]</li>
        <ul>
{% if i.caption %}
            <li>{{ i.caption }}</li>
{% endif %}
        </ul>
    {% endfor %}
    </ul>
{% else %}
No Routes.
{% endif %}

<h3>POI:</h3>
{% if poi_list %}
    <ul>
    {% for i in poi_list %}
        <li>{{ i.name }}</li>
        <ul>
{% if i.caption %}
            <li>{{ i.caption }}</li>
{% endif %}
            <li><a href="{% url poi-kml i.pk %}">kml</a></li>
            <li><a href="http://maps.google.com/?q={{ fully_qualified_django_url }}{% url poi-kml i.pk %}">google map</a></li>
        </ul>
    {% endfor %}
    </ul>
{% else %}
No POI.
{% endif %}

<h3>Areas:</h3>
{% if area_list %}
    <ul>
    {% for i in area_list %}
        <li>{{ i.name }} [
        <a href="{% url area-kml i.pk %}">kml</a>
        | <a href="{% url area-map i.pk %}">map</a>
{% if user %}{% ifequal user.id i.user.id %}
        | edit
{% endifequal %}{% endif %}
        ]</li>
    {% endfor %}
    </ul>
{% else %}
No Areas.
{% endif %}

<h3>Photos:
{% if photo_list %}
[<a href="http://maps.google.com/?q={{ fully_qualified_django_url }}{% url tag-photos-kml tag.pk %}">Map All Photos</a>]
{% endif %}
</h3>
{% if photo_list %}
    <ul>
    {% for i in photo_list %}
        <li><img src="{{ i.image|thumbnail }}" alt="{{ i.name }}" /><br />
            {{ i.name }} [
            <a href="{% url photo-page i.pk %}">details</a>
            | <a href="{% url photo-kml i.pk %}">kml</a>
            | <a href="http://maps.google.com/?q={{ fully_qualified_django_url }}{% url photo-kml i.pk %}">google map</a>
            ]<br /><br /></li>
    {% endfor %}
    </ul>
{% else %}
No Photos.
{% endif %}

<h3>TrackPoints:</h3>
<ul>
{% if trackpoints %}
<li>There are {{ trackpoints }} TrackPoints associated with this tag.</li>
<li><a href="">Create Route</a> (TODO)</li>
{% else %}
<li>There are no TrackPoints associated with this tag.</li>
{% endif %}
</ul>
{% endblock %}
